package no.sachmuld.methodcombination.impl.validate;

/**
 *
 */
public class BehaviourClassIsIncompatibleWithBehaviourChain extends MethodCombinationValidationError {

    private Class behaviourClass;
    private Class behaviourClassFromChain;

    public BehaviourClassIsIncompatibleWithBehaviourChain(Class targetClass, Class behaviourClass, Class behaviourClassFromChain) {
        super(targetClass);
        this.behaviourClass = behaviourClass;
        this.behaviourClassFromChain = behaviourClassFromChain;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Incompatible behaviour class for class ");
        sb.append(getTargetClass().getName());
        sb.append(". ");
        sb.append(behaviourClass.getSimpleName());
        sb.append(" must must be a subclass of ");
        sb.append(behaviourClassFromChain.getSimpleName());
        return sb.toString();
    }
}
